
/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */

require('./bootstrap');

window.Vue = require('vue');

/******************请求访问地址**********************/
Vue.prototype.adminApi = function (str) {  //不是全局变量 原型属性
  return "http://vue-admin.demo/" + str;
}
Vue.prototype.webApi = function (str) {
 return "http://vue-web.demo/" + str;
}

/*************************注册组件**************************/
Vue.component('app', require('./components/admin/app.vue'));
Vue.component('my-menu', require('./components/admin/menu.vue')); //菜单栏
Vue.component('hint', require('./components/admin/hint.vue'));
Vue.component('now-position', require('./components/admin/now-position.vue'));

/*****************加载组件**************************/
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

import router from './admin-router'

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

// const router = new VueRouter({
//     routes // （缩写）相当于 routes: routes
// });

// router.beforeEach((to, from, next) => {
//     console.log(to);
// });

// const app = new Vue({
//     el: '#app'
// });
const app = new Vue({
    router
}).$mount('#app');